#include <string.h>
#include <stdio.h>

#define IPMSG_OUT_MSG_COLOR(x) {write(1, "\033[31m", 5); x write(1, "\033[32m", 5);}

char *help = "*******************************************************\n"
             "*  send/say  [username]			: 发送消息			*\n"
             "*  sendfile  [username]  [filename...] 	: 发送消息			*\n"
             "*  getfile      [filenum]				: 发送消息			*\n"
             "*  list/ls						: 打印用户列表		*\n"
             "*  \"list/ls  file\"			              	: 打印用户列表		*\n"
             "*  clear/cls						: 清屏				*\n"
             "*  help							: 帮助				*\n"
             "*  exit/quit						: 退出				*\n"
             "**********************************************************************\n";

int main(int argc, char const *argv[])
{
   char str[80] = "send Sunplusapp hello";
   const char s[2] = " ";
   char *token;
   
   /* 获取第一个子字符串 */
   token = strtok(str, s);
   
   /* 继续获取其他的子字符串 */
   while( token != NULL ) {
      printf( "%s\n", token );
    
      token = strtok(NULL, s);
   }

   IPMSG_OUT_MSG_COLOR(printf("%s", help);)
   
    return 0;
}
